package com.abc.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@Schema(description = "文件解析请求")
public class FileParseRequest {

    @NotNull(message = "文件不能为空")
    @Schema(description = "要解析的文件")
    private MultipartFile file;

    @NotBlank(message = "工具类型不能为空")
    @Pattern(regexp = "^(lite|expert|prime)$", message = "工具类型只能是 lite、expert 或 prime")
    @Schema(description = "解析引擎类型：lite-快速文本提取，expert-高精度PDF/表格/OCR，prime-顶级精度复杂布局", allowableValues = {"lite", "expert", "prime"})
    private String toolType;

    @NotBlank(message = "文件类型不能为空")
    @Pattern(regexp = "^(PDF|DOCX|DOC|XLS|XLSX|PPT|PPTX|PNG|JPG|JPEG|CSV|TXT|MD|HTML|EPUB|BMP|GIF|WEBP|HEIC|EPS|ICNS|IM|PCX|PPM|TIFF|XBM|HEIF|JP2)$", message = "不支持的文件类型")
    @Schema(description = "文件格式类型")
    private String fileType;
}